From: Cosimo Cecchi Date: Tue, 19 Jun 2012 18:49:40 +0000 (-0400) Subject: automount: don't allow autorun for things we mount at startup X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6451 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=646435ee3ed47ea2130237495237aa6df3c0fba6;p=gnome-shell.git automount: don't allow autorun for things we mount at startup We don't want to potentially flood the user with notifications about mounts when starting up the system. https://bugzilla.gnome.org/show_bug.cgi?id=660595 --- diff --git a/js/ui/automountManager.js b/js/ui/automountManager.js index 0d3b6c962..e3db54f0b 100644 --- a/js/ui/automountManager.js +++ b/js/ui/automountManager.js @@ -123,7 +123,8 @@ const AutomountManager = new Lang.Class({ let volumes = this._volumeMonitor.get_volumes(); volumes.forEach(Lang.bind(this, function(volume) { this._checkAndMountVolume(volume, { checkSession: false, - useMountOp: false }); + useMountOp: false, + allowAutorun: false }); })); return false; @@ -201,7 +202,8 @@ const AutomountManager = new Lang.Class({ _checkAndMountVolume: function(volume, params) { params = Params.parse(params, { checkSession: true, - useMountOp: true }); + useMountOp: true, + allowAutorun: true }); if (params.checkSession) { // if we're not in the current ConsoleKit session, @@ -236,14 +238,16 @@ const AutomountManager = new Lang.Class({ if (params.useMountOp) { let operation = new ShellMountOperation.ShellMountOperation(volume); - this._mountVolume(volume, operation.mountOp); + this._mountVolume(volume, operation.mountOp, params.allowAutorun); } else { - this._mountVolume(volume, null); + this._mountVolume(volume, null, params.allowAutorun); } }, - _mountVolume: function(volume, operation) { - this._allowAutorun(volume); + _mountVolume: function(volume, operation, allowAutorun) { + if (allowAutorun) + this._allowAutorun(volume); + volume.mount(0, operation, null, Lang.bind(this, this._onVolumeMounted)); },